<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Users extends CI_Controller {

 function __construct()
 {
   parent::__construct();
   $this->load->helper(array('form', 'url'));
 }

 function index()
 {
	$data['login']=$this->session->userdata('logged_in');
    $this->load->view('user/user_home',$data);
 }
 function updateUser(){
	 $logindata=$this->session->userdata('logged_in');
	 $id= $logindata['id'];
	 $this->User->setId($id);
	$data['mydata']=$this->User->getIdUser();
	
	$this->load->view('user/user_update',$data);
 }
 function test1(){
	 echo 'fff';
 }
 function test2(){
	 echo 'uuu';
 }
 
 function updateDataUser(){
		
		$this->User->setId($this->input->post('id'));
		$this->User->setName($this->input->post('name'));
		$this->User->setLastname($this->input->post('lastname'));

		$this->User->updateUser();
		
  header( 'Location: '.base_url().'index.php/users' ); 
	}
 
}
?>

